package com.多线程;

public class weekup extends Thread {

  public static void main(String[] args) throws Exception{
    Thread t1 = new Thread(()->{
        刷牙();
    });
    Thread t2 = new Thread(()->{
        煮鸡蛋();
    });
    Thread t3 = new Thread(()->{
        烧水();
    });
    t1.start();
    t3.start();
    t2.start();

    t1.join();
    t2.join();
    t3.join();

    吃鸡蛋();
    洗脸();



  }

  @Override
  public void run() {

  }

  public static void 刷牙() {
    try {
      Thread.sleep(5000);
      System.out.println("刷牙");
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }

  public static void 洗脸() {
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("洗脸");
  }

  public static void 烧水() {
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("烧水");
  }

  public static void 煮鸡蛋() {
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("煮鸡蛋");
  }

  public static void 吃鸡蛋() {
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    System.out.println("吃鸡蛋");
  }
}
